/**
 * ************************************************************************
 *
 * @file    Version.h
 * @brief   版本控制
 * @author  负号科技(fuhaokj@foxmail.com)
 * @version 0.1
 * @date    2023-08-25
 *
 * ************************************************************************
 *   __       _                 _    _
 *  / _|     | |               | |  (_)
 * | |_ _   _| |__   __ _  ___ | | ___
 * |  _| | | | '_ \ / _` |/ _ \| |/ / |
 * | | | |_| | | | | (_| | (_) |   <| |
 * |_|  \__,_|_| |_|\__,_|\___/|_|\_\ |
 *                                 _/ |
 *                                |__/
 *
 * @copyright Copyright (c) 2023 负号科技
 * For study and research only, no reprinting
 * ************************************************************************
 */
#ifndef __VERSIONU_H__
#define __VERSIONU_H__

#include <stdint.h>
#include "BuildTime.h"
#include "config.h"

#define Base        0     /*研发基础版本*/
#define Alpha       1     /*开发者内部版本*/
#define Beta        2     /*测试版本*/
#define RC          3     /*成熟版本*/
#define Release     4     /*正式版本（最终版）*/
#define standard    5     /*标准版*/
#define full        6     /*完整版，即正式版*/
#define lts         7     /*长期维护版本*/
#define ultimate    8     /*旗舰版*/
#define demo        9     /*演示版*/
#define enhance     10    /*增强版*/
#define free        11    /*自由版*/
#define upgrade     12    /*升级版*/


#define PROJECT_NAME_BYTE 16

typedef struct
{
    char project[sizeof(PROJECT_NAME) + 1];
    uint64_t version;
    BUILD_TIME_TYPE_DEF time;
} msg_version_char;

#pragma pack(push, 1)
typedef struct
{
    const uint8_t head1;
	const uint8_t head2;
    uint64_t version;
    uint32_t year;
    uint8_t month;
    uint8_t day;
    uint8_t hour;
    const uint8_t tail1;
    const uint8_t tail2;
} msg_version_bin;
#pragma pack(pop)

void PrintVersionInformation(void);
char *VersionPrintParameters(char *str);
msg_version_bin *VersionParametersBIN(msg_version_bin *str);

#endif
